package com.henu.engineer.dao.mapper.student

import com.henu.engineer.dao.entity.student.StudentScore
import org.apache.ibatis.annotations.Mapper
import org.springframework.stereotype.Repository

/**
 * 学生试卷成绩表
 *
 * @author noexcept
 * @date 2021/7/27 11:36
 */
@Mapper
@Repository
interface StudentScoreXmlMapper {
    fun insertStudentScore(student: StudentScore): Boolean
    fun insertStudentScores(scoreList: List<StudentScore>): Int

    fun selectStudentAllScores(studentId: String): List<StudentScore>

    /**
     * 查询某个课程所有学生的成绩
     * @param courseId
     * @return
     */
    fun selectStudentScoresByCourse(courseId: String): List<StudentScore>

    /**
     * 根据学号，试卷id查询
     */
    fun selectByStudentIdTestPaperId(studentId: String, testPaperId: String): StudentScore?

    /**
     * 更改某学生某课程的分数
     * @param studentId
     * @param courseId
     * @return
     */
    fun updateStudentScore(studentId: String, courseId: String, score: Double): Boolean
}